using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
namespace MRSite.Entity
{
    /// <summary>
    /// 报单表
    /// </summary>
    [Table(Name = "declaration")]
    public class Declaration : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "user_id")]
        public int user_id { get; set; }



        /// <summary>
        /// 报单金额
        /// </summary>
        [Column(Name = "amount")]
        public Decimal amount { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "addtime", IsDbGenerated = true)]
        public DateTime addtime { get; set; }

        /// <summary>
        ///  交易单号
        /// </summary>
        [Column(Name = "trade_no")]
        public String trade_no { get; set; }


        /// <summary>
        ///0待处理,1已支付,2已取消
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "remark")]
        public String remark { get; set; }

        /// <summary>
        /// 消费金额
        /// </summary>
        [Column(Name = "xfmoney")]
        public Decimal xfmoney { get; set; }

        /// <summary>
        /// 消费积分
        /// </summary>
        [Column(Name = "xfpoints")]
        public Decimal xfpoints { get; set; }

        /// <summary>
        /// 代报单用户id
        /// </summary>
        [Column(Name = "bduser_id")]
        public int bduser_id { get; set; }



        /// <summary>
        /// 级别
        /// </summary>
        [Column(Name = "levels")]
        public int levels { get; set; }




        /// <summary>
        ///  审核时间
        /// </summary>
        [Column(Name = "checktime")]
        public DateTime? checktime { get; set; }

        /// <summary>
        /// 审核备注
        /// </summary>
        [Column(Name = "checkremark")]
        public string checkremark { get; set; }


        /// <summary>
        ///  赠送金币 月产量
        /// </summary>
        [Column(Name = "zsgolds")]
        public Decimal zsgolds { get; set; }

        /// <summary>
        /// 已返金币
        /// </summary>
        [Column(Name = "returngolds")]
        public Decimal returngolds { get; set; }

        /// <summary>
        /// 返点状态0返点中,1已返完,2已作废
        /// </summary>
        [Column(Name = "returnstatus")]
        public int returnstatus { get; set; }

        /// <summary>
        /// 报单类别(1:投资，能返金币；0：金币复投，不能返金币)
        /// </summary>
        [Column(Name = "bdtype")]
        public int bdtype { get; set; }


        /// <summary>
        /// 当前本金= 注册本金+日返金币 
        /// </summary>
        [Column(Name = "currentbj")]
        public Decimal currentbj { get; set; }


        /// <summary>
        /// 日返金币 百分比
        /// </summary>
        [Column(Name = "daygold")]
        public Decimal daygold { get; set; }

        /// <summary>
        /// 可领取金币
        /// </summary>
        [Column(Name = "canlqgold")]
        public Decimal canlqgold { get; set; }



        /// <summary>
        /// 日返开始时间
        /// </summary>
        [Column(Name = "starttime")]
        public DateTime? starttime { get; set; }

        /// <summary>
        /// 日返结束时间
        /// </summary>
        [Column(Name = "endtime")]
        public DateTime? endtime { get; set; }




        private EntityRef<Customer> _member;

        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_member", ThisKey = "user_id", OtherKey = "id")]
        public Customer CustomerItem
        {
            get { return this._member.Entity; }
            set { this._member.Entity = value; }
        }
    }
}

